package brvh;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sumansoul.multiplerecycleview.R;

import java.util.List;

public class MultipleItemQuickAdapter extends BaseMultiItemQuickAdapter<MultipleItem, BaseViewHolder> {

    public MultipleItemQuickAdapter(List data) {
        super(data);
        //布局1
        addItemType(MultipleItem.TYPE_TEXT, R.layout.item_news_content);
        //布局2
        addItemType(MultipleItem.TYPE_VIDEO, R.layout.item_video_content);
        //布局3
        addItemType(MultipleItem.TYPE_PIC, R.layout.item_news_pic);
        //布局4
        addItemType(MultipleItem.TYPE_PIC2, R.layout.item_news_pic2);
    }

    @Override
    protected void convert(BaseViewHolder helper, MultipleItem item) {
        switch (helper.getItemViewType()) {
            case MultipleItem.TYPE_TEXT:
                //设置文字布局的值
                //helper.setImageUrl(R.id.tv, item.getContent());
                break;
            case MultipleItem.TYPE_VIDEO:
                //设置视频布局的值
                // helper.setImageUrl(R.id.iv, item.getContent());
                break;
            case MultipleItem.TYPE_PIC:
                //设置图片布局的值
                break;
            case MultipleItem.TYPE_PIC2:
                //设置图片2布局的值
                break;
        }
    }
}
